package io.github.eric.urpc.standalone.server;

import io.github.eric.urpc.server.Server;
import io.github.eric.urpc.server.ServerConfig;

import java.util.Collections;

public class Application {
    public static Server SERVER;

    public static void main(String[] args) {
        ServerConfig serverConfig = new ServerConfig.Builder()
//                .nettyLoggingLevel(LogLevel.INFO)
                .applicationName("standalone-server")
                .listenPort(52379)
                .heartBeatTimeout(15)
                // set controllers
                .connectionListeners(Collections.singletonList(UserManager.getInstance()))
                .rpcControllers(Collections.singletonList(new ServerRpcController()))
                .build();

        // init server
        SERVER = new Server(serverConfig);
        SERVER.start();
    }
}